package pack0713;

public class Test4 {
    public static void main(String[] args) {
         new Thread(()->{
             for (int i = 0; i < 30; i++) {
                 System.out.println(Thread.currentThread().getName()+":"+i);
                 try {
                     Thread.sleep(100);
                 } catch (InterruptedException e) {
                     e.printStackTrace();
                 }
             }
         },"线程1").start();

         new Thread(()->{
             for (int i = 0; i <30 ; i++) {
                 System.out.println(Thread.currentThread().getName()+":"+i);
                 try {
                     Thread.sleep(100);
                 } catch (InterruptedException e) {
                     e.printStackTrace();
                 }
             }
         },"线程2").start();
    }
}
